import request from '@/utils/request';

const orderBaseURL = '/order'

export function getOrderDetailById(params){
    return request({
        url: orderBaseURL+'/getOrderDetailById',
        method: 'get',
        params
    })
}

export function deleteOrderById(data){
    return request({
        url: orderBaseURL+'/deleteOrderById',
        method: 'post',
        data
    })
}

export function createOrder(data){
    return request({
        url: orderBaseURL+'/createOrder',
        method: 'post',
        data
    })
}

    /**
     * 用户创建订单
     *
     * @param command
     * 用户id
     * private Long flowerUserId;
     * 商品id
     * private Long itemId;
     * 商品数量
     *private Integer number;
     * 预约时间
     *private Date appointmentTime;
     * 订单备注（非必要）
     * private String description;
     * 地址
     *  private String address;
     * @return
     */
     export function userCreateOrder(data){
        return request({
            url: orderBaseURL+'/userCreateOrder',
            method: 'post',
            data
        })
    }

export function updateOrder(data){
    return request({
        url: orderBaseURL+'/updateOrder',
        method: 'post',
        data
    })
}

export function getOrderPage(params) {
    return request({
        url: orderBaseURL+'/getOrderPage',
        method: 'get',
        params
    })
}

export function getFlowerUserOrderByFlowerUserId(params) {
    return request({
        url: orderBaseURL+'/getFlowerUserOrderByFlowerUserId',
        method: 'get',
        params
    })
}

export function getFlowerUserOrderByCurrentUser(params) {
    return request({
        url: orderBaseURL+'/getFlowerUserOrderByCurrentUser',
        method: 'get',
        params
    })
}

export function getAllOrderData(params) {
    return request({
        url: orderBaseURL+'/getAllOrderData',
        method: 'get',
        params
    })
}

export function getOrderTotalCount(params) {
    return request({
        url: orderBaseURL+'/getOrderTotalCount',
        method: 'get',
        params
    })
}
